#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    //点击获取当前值
    connect(ui->btnget, &QPushButton::clicked,[=]()
    {
        qDebug()<<ui->widget->getnum();
    });


    //设置到一半
    connect(ui->btnset, &QPushButton::clicked , [=]()
    {
        ui->widget->setnum(50);
    });


}

Widget::~Widget()
{
    delete ui;
}
